-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: misc improvements in tests #60
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add type information indicating that result code will always be either 0 or 1
Use information found in test usage to adjust types throughout the project. Also type constants in tests
Add utility functions to de-duplicate the common logic of adding packages and search results to the mock package registry in tests
Split utilities file into mock-work-dir and mock-console
Hide implementation detail of what mock console is used from tests
Add helpers to check for correct manifest in add cmd tests
Move logic for, creating, resetting and querying mock console content into dedicated functions
To avoid warnings. Only dev dependencies
Move manifest assertion helpers to own module so they can be reused
prepare for allowing to chain multiple assertions on same manifest
Use manifest assertions in cmd remove tests. Also add a few new ones
Use manifest assertions in manifest tests
There should never be a version inside the name
favoyang
approved these changes
Nov 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GLTM. The refactoring has made the unit tests look much cleaner.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was originally meant to introduce property-based tests (see #59). After some experiments it did not seem to add to much test security, so this was abandoned (Notice fast-check dependency was added and later removed)
Instead this PR includes various small changes that can be summarized with:
utilities.ts
and group common functionality in new modules